package com.bitnei.battery.examples;

import com.bitnei.battery.bean.dataBean.repair.VehRepair;
import com.bitnei.battery.bean.dataBean.retire.BatRetire;
import com.bitnei.battery.constants.BatterySpecies;
import com.bitnei.battery.constants.BatteryType;

import java.util.ArrayList;
import java.util.List;

/**
 * @author czl
 * @email czl_nylg@163.com
 * @date 2019/10/15 10:36
 * @Version 1.0
 * @Description: 电池退役示例
 */
public class BatRetireExample {

    public static void main(String[] args){
        //请求地址
        //电池厂退役(退役范围  车辆维修换下电池  换电出库电池)
//        String url = "http://127.0.0.1:8999/bitnei/v1.0/battery/receiveRetiredOld";
        //回收网点退役(退役范围  回收网点录入电池 车辆维修换下电池  换电出库电池)
        String url = "http://127.0.0.1:8999/bitnei/v1.0/battery/receiveRetiredOldVehicle";
        //换电退役(退役范围 换电出库电池)
//        String url = "http://127.0.0.1:8999/bitnei/v1.0/battery/receiveRetiredOldReplace";

        //组装数据
        List<BatRetire> retireList = mockRetire();
        //调用接口
        ApiUtilExample.callApi(url,retireList);
    }


    /**
     * 模拟退役数据（三种退役方式 数据结构一样）
     * @return
     */
    private static List<BatRetire> mockRetire(){
        List<BatRetire> retireList = new ArrayList<>();
        BatRetire batRetire = new BatRetire();
        batRetire.setCode("101PE00000");
        batRetire.setBatteryType(BatteryType.SY.getCode());
        batRetire.setBatterySpecies(BatterySpecies.P.getCode());
        batRetire.setRetireDate("2018-04-10");
        batRetire.setBatteryWeight("20.00");
        batRetire.setRetireUnitCode("91430111MA4L16XXXX");
        batRetire.setRetireUnitName("电池退役企业");
        batRetire.setWhereaboutsCode("78430111MA4L16XXXX");
        batRetire.setRetireUnitName("电池报废企业");
        retireList.add(batRetire);
        return retireList;
    }


}
